package main

import (
	"io/ioutil"
	"fmt"
	"os"
)

func copyFile(src string, dst string) (result string) {
	var content, err = ioutil.ReadFile(src)
	if err != nil {
		return "文件读取失败"
	}
	err = ioutil.WriteFile(dst, content, os.ModePerm)
	if err != nil {
		return "文件写入失败"
	}
	return "文件写入成功"
}

func main() {
	fmt.Println(copyFile("D:/dev/golang/dadi/test.txt", "D:/dev/golang/dadi/test1.txt"))
}